# Author    :Dun_Hz
# Time      :2024/3/17 11:08
# 找零钱，返回最少的硬币数
def main():
    d = [0.01,0.02,0.05,0.1,0.2,0.5,1.0]
    d_num = []
    s = 0
    temp = input('请输入每种零钱的数量: ')
    d_num0 = temp.split(',')
    for i in range(len(d_num0)):
        d_num.append(int(d_num0[i]))
        s += d[i]*d_num[i]
    sum = float(input('请输入要找的零钱：'))
    if sum > s:
        print('找不开')
        return 0
    i = 6
    while i>=0:
        if sum>=d[i]:
            n = int(sum/d[i])

            if n>= d_num[i]:
                n = d_num[i]

            sum = round(sum-n*d[i],2)

            print('用了%d个%f元硬币'%(n,d[i]))
        i -= 1

if __name__=='__main__':
    main()
